home *** CD-ROM | disk | FTP | other *** search
- ; Update PhotoFolio from 2.0 to 2.1
- ; $VER: Update-PhotoFolio V1.2 (14.12.2000)
- ; © 2000 Steeple Software
- ;
-
- (set #catalog 0) ; english language is default
-
- ; *********************** Find the current language
- (set #i 0)
- (while (set #thisfile (select #i
- "english" "italiano" "deutsch" "español" "czech" "català" "dansk" "français"
- "hrvatski" "nederlands" "norsk" "polski" "português"
- "russian" "srpski" "suomi" "svenska" "ÃeÓtina"
- ""))
- (
- (if (= @language #thisfile)
- (
- (set #catalog #i)
- (set #catalogname #thisfile)
- )
- )
- (set #i (+ #i 1))
- )
- )
-
- ; *********************** Query user for their language, using system as default
- ;(set #catalog
- ; (askchoice
- ; (prompt "Select your native language (language for installer)")
- ; (help @askoptions-help)
- ; (choices "English" "Italiano" "Deutsch" "Español" "Czech")
- ; (default #catalog)
- ; )
- ;)
-
- ; *********************** Reset #catalogname as the user may have changed the language above
- ;(if (< #catalog 5)
- ; (
- ; (set #catalogname (select #catalog "english" "italiano" "deutsch" "español" "czech"))
- ; )
- ;)
-
- ; *********************** Strings common for all languages
- (set #HOMEPAGE "http://steeplesoftware.dragonfruit.org")
- (set #BLANK "\n")
-
- ; *********************** English texts
- (set #INITIAL_MESSAGE
- (cat "Steeple Software and Schatztruhe\nPresent PhotoFolio 2.1\n\n"
- "This installation script will update PhotoFolio V2.0 to V2.1\n"
- "and also update other distributed files.\n"
- "It does not perform a complete installation of PhotoFolio. Although\n"
- "you will be asked similar questions as during the original installation\n"
- "process, this update will only work on an existing PhotoFolio installation.\n"
- "\n"
- "Please note that this update process will overwrite\n"
- "all files to be updated, no backup copies will be made."
- )
- )
- (set #WRONG_INSTALLER_VERSION "\n\n\n\nYou need at least version 42.9 of Installer\nto update PhotoFolio")
- (set #WRONG_CPU "\n\n\n\nYou need a 68020 CPU or better\nto run PhotoFolio")
- (set #WRONG_OS_VERSION "\n\n\n\nYou need at least AmigaOS V3.0\nto run PhotoFolio")
- (set #WRONG_MUI_VERSION "\n\n\n\nYou need at least MUI V3.8\nto run PhotoFolio")
- (set #SELECT_PHOTOFOLIO_DIRECTORY "Select the directory where PhotoFolio is installed.")
- (set #NOT_FOUND_TRY_AGAIN "PhotoFolio was not found in that directory, try again.")
- (set #PROMPT_INSTALL_PPC "Install PPC (WarpOS) modules where appropriate")
- (set #PATCHING_PHOTOFOLIO_20 "Patch PhotoFolio from 2.0 to 2.1")
- (set #INSTALLING_LIBRARY "\nInstalling PhotoFolio library")
- (set #INSTALLING_PATCH "Patching")
- (set #PROMPT_INSTALL_IMAGEIOPREFS "\nInstall imageio.library prefs?\n\n(Used to alter the loading formats and\nother parameters of image loading)")
- (set #INSTALLING_IMAGEIOPREFS "\nInstalling imageio.library prefs")
- (set #PROMPT_INSTALL_JPEGPREFS "\nInstall jpeg.library prefs?\n\n(Used to alter the way jpeg images are loaded)")
- (set #INSTALLING_JPEGPREFS "\nInstalling jpeg.library prefs")
- (set #PROMPT_INSTALL_CATALOG "\nWhich language catalogs would you like to install?")
- (set #INSTALLING_CATALOG "\nInstalling PhotoFolio catalog")
- (set #UPDATING_MUI_PREFS "Updating PhotoFolio's MUI preferences")
- (set #PHOTOFOLIO_ASSIGN "Adding PhotoFolio assign to S:User-Startup")
- (set #UPDATE_COMPLETED
- (cat "PhotoFolio has successfully been updated to V2.1.\n\n"
- "You will need to re-enter your registration code when you run\n"
- "PhotoFolio 2.1 for the first time.\n\n"
- "If you have not registered your copy of PhotoFolio yet, you can do it online at\n"
- #HOMEPAGE "\n\n"
- "Remember to check for new updates at the PhotoFolio homepage:\n"
- #HOMEPAGE
- )
- )
- (set #YES "Yes")
- (set #NO "No")
-
- ; ************************* Global procedures
- (procedure P_copylib lib destpath newlibname
- (
- (copylib
- (prompt (cat (cat #INSTALLING_LIBRARY " ") (fileonly newlibname)))
- (help @copylib-help)
- (newname newlibname)
- (source lib)
- (dest destpath)
- (confirm)
- )
- )
- )
-
- (procedure P_copymcc mcc destpath
- (
- (copylib
- (prompt (cat (cat #INSTALLING_MCC " ") (fileonly mcc)))
- (help @copylib-help)
- (source mcc)
- (dest destpath)
- (confirm)
- )
- )
- )
-
- (procedure P_patchfile #patch #orig #to #msg
- (
- (set #cmd (cat "spatch -o" (tackon #to (fileonly #orig))
- " -p" #patch ".pch"
- " " "PhotoFolio_2.0:" #orig)
- )
- (working (cat #INSTALLING_PATCH "\"" (fileonly #orig) "\""))
- (message #msg)
- (run #cmd)
- )
- )
-
-
- ; *********************** Check essential version numbers
- (if (< @installer-version (+ (* 65536 42) 9))
- (abort #WRONG_INSTALLER_VERSION)
- )
-
- (if (< (database "cpu") 68020 )
- (abort #WRONG_CPU)
- )
-
- (set os_version (/ (getversion "exec.library" (resident)) 65536))
- (if (< os_version 39)
- (abort #WRONG_OS_VERSION)
- )
-
- ; *********************** Is MUI installed
- (set muiinstall_required 0)
- (if (= (exists "MUI:" (noreq)) 0)
- (
- (set muiinstall_required 1)
- )
- (
- (set mui_version (getversion "MUI:Libs/muimaster.library" ))
- (if (< mui_version 1245219)
- (
- (set muiinstall_required 1)
- )
- )
- )
- )
-
- (if (= muiinstall_required 1)
- (abort #WRONG_MUI_VERSION)
- )
-
- ; *********************** All essential versions are correct, continue installation
- (message #INITIAL_MESSAGE)
-
- (complete 0)
-
- ; *********************** Select original installation directory for update
- (set #notfound 1)
- (while #notfound
- (
- (set destination
- (askdir
- (prompt #SELECT_PHOTOFOLIO_DIRECTORY)
- (help @askdir-help)
- (default @default-dest)
- )
- )
-
- (if (= (exists (tackon destination "PhotoFolio")) 1)
- (
- (set #notfound 0)
- )
- (
- (message #NOT_FOUND_TRY_AGAIN)
- )
- )
- )
- )
-
- (set @default-dest destination)
-
- ; *********************** Establish default MUI install location
- (if (= (exists "MUI:Libs/mui") 0)
- (
- (set #muipath (tackon destination "mui"))
- (makedir #muipath)
- )
- (
- (set #muipath "MUI:Libs/mui")
- )
- )
-
- ; *********************** Establish CPU type
- (set #ourcpu 0)
- (set #i 0)
- (while (set #thiscpu (select #i "68020" "68030" "68040" "68060" ""))
- (
- (if (= (database "cpu") #thiscpu) (set #ourcpu #i))
- (set #i (+ #i 1))
- )
- )
-
- ; *********************** Is WarpOS installed
- (set #ppc 1) ; No PPC by default
-
- (set warpos_version 0)
- (set warpos_version (getversion "warp.library" ))
- (if (> warpos_version 0)
- (
- (set #ppc 0)
-
- (set #ppc
- (askchoice
- (help @askchoice-help)
- (prompt #PROMPT_INSTALL_PPC)
- (choices #YES #NO)
- (default #ppc)
- )
- )
- )
- )
-
- (complete 12)
-
- ; *********************** Patch PhotoFolio to V2.1
- (makeassign "PHOTOFOLIO_DEST_TEMP" @default-dest)
- (P_patchfile "PhotoFolio21" "PhotoFolio" "PHOTOFOLIO_DEST_TEMP:" #PATCHING_PHOTOFOLIO_20)
- (makeassign "PHOTOFOLIO_DEST_TEMP")
-
- (complete 24)
-
- ; *********************** Install new imageio.library
- (P_copylib (select #ourcpu "Support/imageio.library/imageio.library_020" "Support/imageio.library/imageio.library_020" "Support/imageio.library/imageio.library_040" "Support/imageio.library/imageio.library_060") "LIBS:" "imageio.library")
-
- (if (=
- (askchoice
- (help @askchoice-help)
- (prompt #PROMPT_INSTALL_IMAGEIOPREFS)
- (choices #YES #NO)
- (default 0)
- ) 0 )
- (
- (copyfiles
- (prompt #INSTALLING_IMAGEIOPREFS)
- (source "Support/imageio.library")
- (choices "ImageIOLibraryPrefs" "ImageIOLibraryPrefs.info" )
- (help @copyfiles-help)
- (dest @default-dest)
- (files)
- (noposition)
- (optional askuser)
- (confirm)
- )
- )
- )
-
- (complete 36)
-
- ; *********************** Install new jpeg.library
- (if (= #ppc 0)
- (
- ; PPC installed
- (P_copylib "Support/jpeg.library/jpeg.library_wos" "LIBS:" "jpeg.library")
- )
- (
- (P_copylib (select #ourcpu "Support/jpeg.library/jpeg.library_020std" "Support/jpeg.library/jpeg.library_020std" "Support/jpeg.library/jpeg.library_040std" "Support/jpeg.library/jpeg.library_060std") "LIBS:" "jpeg.library")
- )
- )
-
- (if (=
- (askchoice
- (help @askchoice-help)
- (prompt #PROMPT_INSTALL_JPEGPREFS)
- (choices #YES #NO)
- (default 0)
- ) 0 )
- (
- (copyfiles
- (prompt #INSTALLING_JPEGPREFS)
- (source "Support/jpeg.library")
- (choices "JpegLibraryPrefs" "JpegLibraryPrefs.info" )
- (help @copyfiles-help)
- (dest @default-dest)
- (files)
- (noposition)
- (optional askuser)
- (confirm)
- )
- )
- )
-
- (complete 48)
-
- ; *********************** Install new proof.library
- (P_copylib (select #ourcpu "Support/proof.library/proof.library_020" "Support/proof.library/proof.library_020" "Support/proof.library/proof.library_040" "Support/proof.library/proof.library_060") "LIBS:" "proof.library")
-
- (complete 60)
-
- ; *********************** Install imageprocess.library
- (if (= #ppc 0)
- (
- ; PPC installed
- (P_copylib "Support/imageprocess.library/imageprocess.library_wos" "LIBS:" "imageprocess.library")
- )
- (
- (P_copylib (select #ourcpu "Support/imageprocess.library/imageprocess.library_020" "Support/imageprocess.library/imageprocess.library_020" "Support/imageprocess.library/imageprocess.library_040" "Support/imageprocess.library/imageprocess.library_060") "LIBS:" "imageprocess.library")
- )
- )
-
- (complete 72)
-
- ; *********************** Install locale catalog
- (set #localedest "LOCALE:Catalogs")
-
- (if (<> #catalog 0)
- (
- (set #localesrc 1) ; Defaults to first entry
- (set #i 0)
- (while (set #thiscat (select #i "italiano" "deutsch" "español" "czech" "français" "nederlands" ""))
- (
- (if (= #catalogname #thiscat)
- (
- (set #x #i)
- (while (> #x 0)
- (set #localesrc (* #localesrc 2))
-
- (set #x (- #x 1))
- )
- )
- )
-
- (set #i (+ #i 1))
- )
- )
- )
- (
- (set #localesrc 0)
- )
- )
-
- (set #installcat
- (askoptions
- (prompt #PROMPT_INSTALL_CATALOG)
- (choices "Italiano" "Deutsch" "Español" "Czech" "Français" "Nederlands")
- (default #localesrc)
- (help @askoptions-help)
- )
- )
-
- (set #i 0)
- (while (< #i 5)
- (set #x #i)
- (set #y 1)
-
- (while (> #x 0)
- (set #y (* #y 2))
-
- (set #x (- #x 1))
- )
-
- (if (bitand #installcat #y)
- (
- (set #localecat (select #i "Italiano" "Deutsch" "Español" "Czech" "Français" "Nederlands"))
-
- (copyfiles
- (prompt (cat (cat #INSTALLING_CATALOG " " ) #localecat))
- (help @copyfiles-help)
- (source (tackon "Catalogs" #localecat))
- (choices "PhotoFolio.catalog")
- (dest (tackon #localedest #localecat))
- (confirm)
- (optional askuser)
- (files)
- )
- )
- )
-
- (set #i (+ #i 1))
- )
-
- (complete 84)
-
- ; *********************** Rename original MUI prefs files and delete key file
- (message #UPDATING_MUI_PREFS)
-
- (if (<> (exists "ENV:mui/PHOTOFOLIO.1.prefs" (noreq)) 0)
- (
- (run "C:Rename FROM=ENV:mui/PHOTOFOLIO.1.prefs TO=ENV:mui/PHOTOFOLIO.prefs")
- )
- )
-
- (if (<> (exists "ENVARC:mui/PHOTOFOLIO.1.prefs" (noreq)) 0)
- (
- (run "C:Rename FROM=ENVARC:mui/PHOTOFOLIO.1.prefs TO=ENVARC:mui/PHOTOFOLIO.prefs")
- )
- )
-
- (set #keyfile (tackon @default-dest "photofolio.key"))
- (run (cat "C:Delete \"" #keyfile "\" QUIET"))
-
- (complete 96)
-
- ; *********************** Add the photofolio assign
- (startup "PhotoFolio - (C) Steeple Software"
- (prompt #PHOTOFOLIO_ASSIGN)
- (help @startup-help)
- (command "C:Assign PhotoFolio: \"" @default-dest "\"\n")
- )
- (makeassign "PhotoFolio" @default-dest)
-
- (complete 100)
-
- ; *********************** Finished
- (message (cat #UPDATE_COMPLETED))
-